package cn.joyfulmedia.dao;

import cn.joyfulmedia.common.util.page.Pagination;
import cn.joyfulmedia.entity.ExamMisAccount;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Set;

public interface ExamMisAccountMapper {
    /**
     * 保存账户
     *
     * @param entity
     * @return
     * @throws Exception
     */
    Integer saveAccount(ExamMisAccount entity) throws Exception;

    Integer updateAccountById(ExamMisAccount entity) throws Exception;

    /**
     * 根据ID查找
     *
     * @param id
     * @return
     * @throws Exception
     */
    ExamMisAccount selectAccountById(Long id) throws Exception;

    /**
     * 根据用户名和用户类型查找用户
     *
     * @param username
     * @return
     */
    ExamMisAccount selectByUsername(String username);

    Integer listPageCount(@Param("user") ExamMisAccount account);

    /**
     * 分页查找
     *
     * @param account
     * @param pagination
     * @return
     */
    List<ExamMisAccount> listPage(@Param("user") ExamMisAccount account,
                                  @Param("pagination") Pagination pagination);

    /**
     * 获取用户权限标识
     *
     * @param username
     * @return
     */
    Set<String> findPermissions(String username);
    
    int deleteByPrimaryKey(Integer id);

    int insert(ExamMisAccount record);

    int insertSelective(ExamMisAccount record);

    ExamMisAccount selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(ExamMisAccount record);

    int updateByPrimaryKey(ExamMisAccount record);
}